<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>客户管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" media="screen" href="css/base.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="css/head.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="css/listAndSelect.css" />
</head>
<body>
<div class="mian-head">
    <div class="mian-head-mid">
        <p class="main-title">客户管理系统</p>
        <div class="mian-head-mid-r">
            <p class="main-hy" th:text="'欢迎：'+${session.myUser.name}+'管理员'"></p>
            <div class="mian-head-mid-r-slpi"></div>
            <p><a th:href="@{getUserMessage(name=${session.myUser.name})}">个人信息</a></p>
            <div class="mian-head-mid-r-slpi"></div>
            <p><a href="logout">退出</a></p>
        </div>
    </div>
</div>

<div class="list-mid">



    <!-- 标题 -->
    <div class="list-title">
        <div class="list-title-div"></div>
        <a th:href="@{GetCustomerList(pageCur=1)}"><p>客户管理</p></a>
<!--        <a href="" class=" loginout userMessage"><p >个人信息</p></a>-->
<!--        <a href="logout" class="loginout"><p >退出登录</p></a>-->
    </div>
    <!-- 查询 -->
    <div class="selectdiv">
        <center>
            <form th:action="@{selectCustomerByParam}" method="post">
                <p>客户名称:</p>
                <input class="select-inputtext" type="text" name="name"/>
                <p>所属行业:</p>
                <select name="industry" class="select-inputselect">
                    <option value="">--请选择--</option>
                    <option value="餐饮">餐饮</option>
                    <option value="房地产">房地产</option>
                    <option value="服务">服务</option>
                    <option value="公益组织">公益组织</option>
                    <option value="教育">教育</option>
                    <option value="计算机">计算机</option>
                    <option value="金融">金融</option>
                    <option value="政府机关">政府机关</option>
                    <option value="农业">农业</option>
                    <option value="旅游业">旅游业</option>
                    <option value="媒体">媒体</option>
                    <option value="其他">其他</option>
                </select>
                <p>客户等级:</p>
                <select name="level" class="select-inputselect">
                    <option value="">--请选择--</option>
                    <option value="普通客户">普通客户</option>
                    <option value="VIP客户">VIP客户</option>
                </select>
                <input type="submit" class="select-inputsubmit" value="查询"/>
            </form>
        </center>
    </div>
    <!-- 列表 -->
    <table class="listtable">
        <tr>
            <th>编号</th>
            <th>姓名</th>
            <th>负责人id</th>
            <th>创建人id</th>
            <th>行业</th>
            <th>等级</th>
            <th>固定电话</th>
            <th>移动电话</th>
            <th>地址</th>
<!--            <th>创建时间</th>-->
            <th  width="100px">操作</td>
        </tr>
            <tr th:each="customer : ${customers}">
                <td th:text="${customer.id}"></td>
                <td th:text="${customer.name}"></td>
                <td th:text="${customer.user_id}"></td>
                <td th:text="${customer.create_id}"></td>
                <td th:text="${customer.industry}"></td>
                <td th:text="${customer.level}"></td>
                <td th:text="${customer.phone}"></td>
                <td th:text="${customer.mobile}"></td>
                <td th:text="${customer.address}"></td>
<!--                <td th:text="${customer.createtime}"></td>-->
                <td >
<!--                    <a href="CustomerGetCustomerbyidServlet?id=${customer.id }">修改</a>-->
<!--                    <a th:href="@{getCustomerById(id=${customer.id})}">查看</a>-->
<!--                    <div class="caozuo-slpi"></div>-->
                    <a th:href="@{getCustomerById(id=${customer.id})}">修改</a>
                    <div class="caozuo-slpi"></div>
<!--                    <a href="javascript:checkDel('${customer.id }')">删除</a>-->
                    <a th:href="@{'javascript:checkDel('+${customer.id}+')'}">删除</a>
                </td>
            </tr>
<!--分页-->
            <tr class="table-bottomtr" th:if="${ifselect ne 'yes'}">
                <td colspan="11">
                    共
                    <span th:text="${totalCount}"></span>
                    条记录&nbsp;&nbsp;共
                    <span th:text="${totalPage}"></span>
                    页&nbsp;&nbsp;
                    第
                    <span th:text="${pageCur}"></span>
                    页&nbsp;&nbsp;
                    <a th:if="${pageCur ne 1 }" th:href="@{GetCustomerList(pageCur=${pageCur - 1 })}" class="page">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
                    <a th:if="${pageCur ne totalPage && totalPage ne 0}" th:href="@{GetCustomerList(pageCur=${pageCur + 1 })}" href="${url_next}" class="page">下一页</a>
                </td>
            </tr>
    </table>
    <div class="inputCustomer"><a href="getUserIldList" >添加客户</a></div>
</div>

    <script type="text/javascript">
        function checkDel(id){
            if(window.confirm("是否删除该联系人？")){
                window.location.href = "deleteCustomer?id="+id;
            }
        }
    </script>
</body>
</html>